 package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * Address generated by hbm2java
 */
@Entity
@Table(name = "Address", catalog = "JobsonTally")
public class Address implements java.io.Serializable
{

   /**
	 * 
	 */
	private static final long serialVersionUID = -4866395917383162846L;
   private Integer id;
   private User user;
   private String street;
   private String additional;
   private String city;
   private String pin;
   private String district;
   private String state;
   private String country;
   private Date modifiedOn;
   private int tableId;
   private Set<Bank> banks = new HashSet<Bank>(0);
   private Set<Customer> customers = new HashSet<Customer>(0);
   private Set<Bank> banks_1 = new HashSet<Bank>(0);
   private Set<Customer> customers_1 = new HashSet<Customer>(0);

   // Flag indicate if update has to be called for Customer Table table 
   private boolean isUpdated = false;
   
   public Address()
   {
	   this.tableId = 1;
	   
   }

   public Address(int tableId)
   {
      this.tableId = tableId;
   }

   public Address(User user, String street, String additional, String city, String pin, String district, String state, String country, Date modifiedOn, int tableId, Set<Bank> banks, Set<Customer> customers, Set<Bank> banks_1, Set<Customer> customers_1)
   {
      this.user = user;
      this.street = street;
      this.additional = additional;
      this.city = city;
      this.pin = pin;
      this.district = district;
      this.state = state;
      this.country = country;
      this.modifiedOn = modifiedOn;
      this.tableId = tableId;
      this.banks = banks;
      this.customers = customers;
      this.banks_1 = banks_1;
      this.customers_1 = customers_1;
   }
   
   public void setIsUpdated(boolean aValue) {
	   this.isUpdated = aValue;
}
   
   @Transient
   public boolean getIsUpdated(){
	   return isUpdated;
   }

   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "ID", unique = true, nullable = false)
   public Integer getId()
   {
      return this.id;
   }

   public void setId(Integer id)
   {
      this.id = id;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ModifiedBy")
   public User getUser()
   {
      return this.user;
   }

   public void setUser(User user)
   {
      this.user = user;
   }

   @Column(name = "Street", length = 65535)
   public String getStreet()
   {
      return this.street;
   }

   public void setStreet(String street)
   {
      this.street = street;
   }

   @Column(name = "Additional", length = 65535)
   public String getAdditional()
   {
      return this.additional;
   }

   public void setAdditional(String additional)
   {
      this.additional = additional;
   }

   @Column(name = "City", length = 65535)
   public String getCity()
   {
      return this.city;
   }

   public void setCity(String city)
   {
      this.city = city;
   }

   @Column(name = "PIN", length = 65535)
   public String getPin()
   {
      return this.pin;
   }

   public void setPin(String pin)
   {
      this.pin = pin;
   }

   @Column(name = "District", length = 65535)
   public String getDistrict()
   {
      return this.district;
   }

   public void setDistrict(String district)
   {
      this.district = district;
   }

   @Column(name = "State", length = 65535)
   public String getState()
   {
      return this.state;
   }

   public void setState(String state)
   {
      this.state = state;
   }

   @Column(name = "Country", length = 65535)
   public String getCountry()
   {
      return this.country;
   }

   public void setCountry(String country)
   {
      this.country = country;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "ModifiedOn", length = 10)
   public Date getModifiedOn()
   {
      return this.modifiedOn;
   }

   public void setModifiedOn(Date modifiedOn)
   {
      this.modifiedOn = modifiedOn;
   }

   @Column(name = "TableID", nullable = false)
   public int getTableId()
   {
      return this.tableId;
   }

   public void setTableId(int tableId)
   {
      this.tableId = tableId;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
   public Set<Bank> getBanks()
   {
      return this.banks;
   }

   public void setBanks(Set<Bank> banks)
   {
      this.banks = banks;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
   public Set<Customer> getCustomers()
   {
      return this.customers;
   }

   public void setCustomers(Set<Customer> customers)
   {
      this.customers = customers;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
   public Set<Bank> getBanks_1()
   {
      return this.banks_1;
   }

   public void setBanks_1(Set<Bank> banks_1)
   {
      this.banks_1 = banks_1;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
   public Set<Customer> getCustomers_1()
   {
      return this.customers_1;
   }

   public void setCustomers_1(Set<Customer> customers_1)
   {
      this.customers_1 = customers_1;
   }

}
